package org.dtp.examples.nacos.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName CatConfiguration
 * @Description Cat配置
 * @Author wangyiqi
 * @Date 2021-08-13-19:55
 **/
@Configuration
public class CatConfiguration {

    /**
     * 配置Cat Filter
     *
     * @return /
     */
    @Bean
    public FilterRegistrationBean catFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        CatServerFilter filter = new CatServerFilter("dynamic-thread-pool");
        registration.setFilter(filter);
        registration.addUrlPatterns("/*");
        registration.setName("cat-filter");
        registration.setOrder(1);
        return registration;
    }

}
